

function addSensorbitCod(Blockly) {




   //碰撞传感器
  Blockly.Python.microbit_knockswitch= function(block) {
    var dropdown_knockswitch = this.getFieldValue('knockswitch');
    Blockly.Python.definitions_['import_microbit'] = 'from microbit import *\n';
    Blockly.Python.definitions_['import_Collision'] = 'from input import collision\n';
    var code = 'collision.is_collided('+ dropdown_knockswitch +')';
    return [code];
  }

    return Blockly;
}

module.exports = addSensorbitCod;

